package com.kaoshi.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kaoshi.entity.Institution;
import com.kaoshi.entity.Team;
import com.kaoshi.mapper.InstitutionMapper;
import com.kaoshi.service.IInstitutionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2024-10-29
 */
@Service
public class InstitutionServiceImpl extends ServiceImpl<InstitutionMapper, Institution> implements IInstitutionService {

    @Autowired
    private InstitutionMapper institutionMapper;

    @Override
    public Page<Institution> findPage(Integer current, Integer pageSize, Team team) {
        Page<Institution> institutionPage = new Page<>(current, pageSize);
        List<Institution> institutionList=institutionMapper.findPage(institutionPage,team);
        institutionPage.setRecords(institutionList);
        return institutionPage;
    }
}
